package ru.zombator.taskman.dbadmin.actions;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;

import ru.zombator.taskman.dbadmin.AdminApp;

public abstract class ASimpleAction extends Action {
	protected AdminApp mainApp;

	public ASimpleAction(AdminApp mainApp) {
		super();
		this.mainApp = mainApp;
	}

	@Override
	public ImageDescriptor getImageDescriptor() {
		String imageName = getImageName();
		return (imageName == null ? null : mainApp.getRegistry()
				.getDescriptor(imageName));
	}

	protected abstract String getImageName();
}